<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class RegisterController extends Controller
{
    //register
    public function register(Request $request)
    {
    	if($request -> isMethod('POST'))
    	{
    		$this -> validate($request,[
    			'email' => 'required|email',
    			'password' => 'required|confirmed',
    			'password_confirmation' => 'required'
    			],[
    			'email.required' => '邮箱不能为空',
    			'email.email' => '邮箱格式不正确',
    			'password.required' => '密码不能为空',
    			'password.confirmed' => '确认密码不一致',
    			'password_confirmation.required' => '请输入确认密码'

    			]);
    		$data = $request -> except('_token');

    	}
    	return view('admin.register');
    }

    //login
    public function login()
    {
    	return view('admin.login');
    }




}
